home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / pxfchmod.z / pxfchmod
Encoding:
Text File  |  1998-10-30  |  5.5 KB  |  120 lines

  1. PXFCHMOD(3F)                                           Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFCCHHMMOODD - Sets file modes for a named file
  6.  
  7. SSYYNNOOPPSSIISS
  8.      CCHHAARRAACCTTEERR*_n _p_a_t_h
  9.      IINNTTEEGGEERR _i_l_e_n,, _i_m_o_d_e,, _i_e_r_r_o_r
  10.      CCAALLLL PPXXFFCCHHMMOODD((_p_a_t_h,, _i_l_e_n,, _i_m_o_d_e,, _i_e_r_r_o_r))
  11.  
  12. IIMMPPLLEEMMEENNTTAATTIIOONN
  13.      UNICOS, UNICOS/mk, and IRIX systems
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      IEEE standard interface for FORTRAN 77
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
  20.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  21.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  22.      7.2 F77 compiler.
  23.  
  24.      The PPXXFFCCHHMMOODD subroutine uses the cchhmmoodd(2) function to set file modes
  25.      for the named file.
  26.  
  27.      The value of _i_m_o_d_e indicates specific file modes.  cchhmmoodd() changes the
  28.      current file modes for the named file in _p_a_t_h to the file mode
  29.      specified in _i_m_o_d_e.
  30.  
  31.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  32.      UNICOS, UNICOS/mk, or IRIX system, all arguments must be of default
  33.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  34.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  35.      IRIX, the default kind is KKIINNDD==44.
  36.  
  37.      The following is a list of valid arguments for this subroutine:
  38.  
  39.      _p_a_t_h      Input character variable or array element containing the
  40.                name of a file.
  41.  
  42.      _i_l_e_n      Input integer variable containing the length of _p_a_t_h in
  43.                characters.  If _i_l_e_n is zero, all trailing blanks are
  44.                removed before calling cchhmmoodd().
  45.  
  46.      _i_m_o_d_e     Input integer variable containing the integer value of the
  47.                symbolic constant for one or more of the following file
  48.                modes:
  49.  
  50.                UUSSEERR      RREEAADD permissions bit:  SS__IIRRUUSSRR
  51.                          WWRRIITTEE permissions bit:  SS__IIWWUUSSRR
  52.                          SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit:  SS__IIXXUUSSRR
  53.                          Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE:  SS__IIRRWWXXUU
  54.  
  55.                GGRROOUUPP     RREEAADD permissions bit:  SS__IIRRGGRRPP
  56.                          WWRRIITTEE permissions bit:  SS__IIWWGGRRPP
  57.                          SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit:  SS__IIXXGGRRPP
  58.                          Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE:  SS__IIRRWWXXGG
  59.  
  60.                OOTTHHEERR     RREEAADD permissions bit:  SS__IIRROOTTHH
  61.                          WWRRIITTEE permissions bit:  SS__IIWWOOTTHH
  62.                          SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit:  SS__IIXXOOTTHH
  63.                          Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE:  SS__IIRRWWXXOO
  64.  
  65.                SSEETTIIDD     Set user IIDD on execution:  SS__IISSUUIIDD
  66.                          Set group IIDD on execution:  SS__IISSGGIIDD
  67.  
  68.                          An integer value for each of these symbolic
  69.                          constants is retrieved through the use of
  70.                          PPXXFFCCOONNSSTT(3F) or IIPPXXFFCCOONNSSTT(3F).  The integer values
  71.                          may be combined through the use of a bitwise
  72.                          inclusive OORR function.
  73.  
  74.      _i_e_r_r_o_r    Output integer variable that contains zero if the requested
  75.                file mode bits are set or nonzero if the requested file mode
  76.                bits are not set.
  77.  
  78.      In addition to the errors returned by the cchhmmoodd(2) system call,
  79.      PPXXFFCCHHMMOODD may return the following errors:
  80.  
  81.      EEIINNVVAALL    If _i_l_e_n < 0 or _i_l_e_n > LLEENN((_p_a_t_h)).
  82.  
  83.      EENNOOMMEEMM    If PPXXFFCCHHMMOODD is unable to obtain memory to copy _p_a_t_h.
  84.  
  85. EEXXAAMMPPLLEESS
  86.           program test
  87.           character*(12) path
  88.           integer ilen, imod, ierr, imodr, imodw
  89.           path = 'testfile'
  90.           imod = 0
  91.           imodr = 0
  92.           imodw = 0
  93.           ilen = 0
  94.  
  95.           call pxfconst('S_IRUSR',imodr,ierr)
  96.           if (ierr.ne.0) then
  97.               print *,'FAIL: error from pxfconst S_IRUSR = ',ierr
  98.               stop
  99.           endif
  100.           call pxfconst('S_IROTH',imodw,ierr)
  101.           if (ierr.ne.0) then
  102.               print *,'FAIL: error from pxfconst S_IWUSR = ',ierr
  103.               stop
  104.           endif
  105.           imod = IOR(imodr,imodw)
  106.           call pxfchmod(path,ilen,imod,ierr)
  107.           if (ierr.ne.0) then
  108.               print *,'FAIL: error from pxfchmod = ',ierr
  109.           else
  110.               print *,'PASS: No error from pxfchmod'
  111.           endif
  112.           end
  113.  
  114. SSEEEE AALLSSOO
  115.      cchhmmoodd(2)
  116.  
  117.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-
  118.      2165, for the printed version of this man page.
  119.  
  120.